﻿<phone:PhoneApplicationPage 
    x:Class="SinaWeiboApp_WP7.LoginPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
    xmlns:mvvm="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"    
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    DataContext="{Binding Login, Source={StaticResource Locator}}"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="新浪微博 via JDCB" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="{Binding Title}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <StackPanel>
                <TextBlock Height="30" HorizontalAlignment="Left" Margin="10,0,0,0" Name="textBlock1" Text="用户名" VerticalAlignment="Top" />
                <TextBox Height="73" HorizontalAlignment="Left"  Name="txtUser" Text="{Binding Id, Mode=TwoWay}" Width="456" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="10,0" Name="textBlock2" Text="密码" VerticalAlignment="Top" />
            <PasswordBox Height="73" Name="txtPwd" Password="{Binding Password, Mode=TwoWay}" />
            <Button Content="登录" HorizontalAlignment="Left"
                    Name="loginButton" IsEnabled="{Binding LoginEnabled}" VerticalAlignment="Top" Width="160">
            	<i:Interaction.Triggers>
            		<i:EventTrigger EventName="Click">
                        <mvvm:EventToCommand Command="{Binding LoginCommand, Mode=OneWay}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>
            </StackPanel>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>
